/**
 * @summary 模糊请求模块
 */

import req from '@/utils/request';
import * as URL from '@/constants/api';

export function getFuzzySearchList(v) {
  return req({
    url: URL.FUZZY_SEARCH_LIST,
    params: {
      q: v,
    }
  })
    .then(res => res.data.data.options.filter(o => o))
    .catch(() => []);
}
export function getSearchList(v) {
  return req({
    url: URL.SEARCH_LIST,
    params: {
      q: v,
    }
  })
    .then(res => res.data.data.results)
    .catch(() => null);
}
